import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
  plugins: [vue()],
  build: {
    rollupOptions: {
      output: {
        manualChunks: {
          'vendor': ['vue', 'pinia', '@vueuse/core'],
          'ui': ['@headlessui/vue', '@heroicons/vue'],
        }
      }
    },
    chunkSizeWarningLimit: 1000,
    cssCodeSplit: true,
    minify: 'terser',
    terserOptions: {
      compress: {
        drop_console: true,
        drop_debugger: true
      }
    },
    assetsInlineLimit: 0, // Disable inlining of assets
    copyPublicDir: true
  },
  optimizeDeps: {
    include: ['vue', 'pinia', '@vueuse/core', '@headlessui/vue', '@heroicons/vue']
  },
  server: {
    host: true,
    port: 5173
  },
  publicDir: 'public'
});